|
Table of Contents
NOTE: you can find this and other lessons in a
more complete and viewable format (including all Figures) in our Tutorial PDF.
Lesson 3. How to Export SMF Data to PC Programs
-
This lesson teaches you how to turn your SMF data into PC export files. It also explains how to produce two or more different outputs (reports and/or files) during a single pass of the input file. The control statements discussed are:
-
the
PC
parm of the
OPTIONS
statement
-
the
NEWOUT
statement
-
To create a PC export file instead of a report, just add this
OPTION
statement near the beginning of your control statements.
OPTION: PC /* MAKE A PC FILE INSTEAD OF A REPORT */
INPUT: SMF14 /* COPY SMF 14 RECORD DEFINITIONS */
INCLUDEIF: SMF14RTY = 14 /* SELECT JUST TYPE 14 RECORDS */
COLUMNS: SMF14DTE SMF14TME SMF14JBN SMF14PGN SMF14TIOE5 SMF14_JFCBDSNM_SMF14_JFCLRECL SMF14EXCP
-
The Figure below shows a portion of the PC file created with the above statements. It also shows the spreadsheet obtained after importing the PC file into Excel.
An Excel spreadsheet containing data from SMF 14 records
 
|
 
-
Let's examine what each statement does. The
OPTION
statement
above tells Spectrum SMF Writer that you want to produce a comma-delimited PC file (instead of a report) in this run. Such PC files can be imported into virtually any PC spreadsheet, data base or word processing program You can use this option to turn virtually any report into a PC export file.
-
The
INPUT
statement identifies the SMF record that contains the data that you want to put into your PC file.
-
The
INCLUDEIF
statement tells which records from the input file to include in your PC export file.
-
The
COLUMNS
statement specifies what columns of data you want in the PC spreadsheet. Here you name the individual fields from the input file that you want to populate the columns of the spreadsheet.
-
With just these four statements, we've given Spectrum SMF Writer everything it needs to turn your selected SMF data into a PC file! That's all there is to creating custom PC files with Spectrum SMF Writer. Four simple statements let you accomplish what would otherwise have taken an entire
COBOL
program to do!
Making Multiple Reports/Export Files in a Single Run
-
What if you want SMF data both as a printed report and as an export file? Spectrum SMF Writer lets you get both outputs during the same run. Producing multiple outputs in a single run lets you avoid having to read and process the large SMF file more than once. That can save lots of I/O and CPU time, an important factor when working with such large files.
-
To produce a second (or third, etc.) output, just add a
NEWOUT
statement to you request.
NEWOUT:
-
This statement should go after you have finished describing the first report that you want. Everything after the
NEWOUT
statement applies only to the new report (or export file).
INPUT: SMF14 /* COPY SMF 14 RECORD DEFINITIONS */
INCLUDEIF: SMF14RTY = 14 /* SELECT JUST TYPE 14 RECORDS */
COLUMNS: SMF14DTE SMF14TME SMF14JBN SMF14PGN SMF14TIOE5 SMF14_JFCBDSNM_SMF14_JFCLRECL SMF14EXCP
NEWOUT:
OPTIONS: PC /* THIS OUTPUT IS A PC FILE, NOT A REPORT */
INCLUDEIF: SMF14RTY = 14 /* SELECT JUST TYPE 14 RECORDS */
COLUMNS: SMF14DTE SMF14TME SMF14JBN SMF14PGN SMF14TIOE5 SMF14_JFCBDSNM_SMF14_JFCLRECL SMF14EXCP
-
The above control statements would produce the report in Figure _ and the export file in Figure _ in the same run. Spectrum SMF Writer will only make a single pass through the SMF input file.
-
Notice that we do not specify another
INPUT
statement after the
NEWOUT
statement. The same input file is always used for all of the outputs in a run.
-
But you are free to change everything else, if you like. In this example, we used the same
INCLUDEIF
statement for both outputs. (We selected all type 14 records.) But the
INCLUDEIF
statements can be completely different, if you like. (For example, it could select a different type of SMF record.)
-
The
COLUMNS
statement can also be different, and so on.
-
When creating additional outputs in a run, your JCL will need a new
DD
for each additional output. In this example, you need a new
SWOUT002
DD
to write the PC export file to. The new
DD
's are numbered sequentially after that (
SWOUT003
, etc.)
Summary
-
Here is a summary of what we learned in this lesson:
-
just add
OPTION: PC
to turn a report into a PC export file
-
an
INCLUDEIF
statement is used to tell Spectrum SMF Writer which records from the input file to include in the report
-
use a
NEWOUT
statement to begin describing a different report or PC file (from the same input file)
-
The next lesson will teach you how to process SMF records that sections which occur more than once in the same record.
To Learn More
-
You can also learn:
-
how to make tab-delimited (rather than comma-delimited) export files
-
how to specify the format to use for dates in the export file
-
how to specify the quote character to be used in the export file
-
how to write single-line (legend style) column headings at the beginning of your export file, with the
HGCOLHDG
option
-
read more about using the
NEWOUT
statement in
-
the complete syntax for the
NEWOUT
statement, in
NEXT LESSON: How to Report on Multiple Occurrences of an SMF Section
|